package services;

import beans.StuInfoBean;
import dao.StuInfoDao;
import dao.StuInfoDaoImpl;

import java.util.List;

public class StuService implements StuInfoDao {
    private final StuInfoDaoImpl stuInfo = new StuInfoDaoImpl();

    @Override
    public int insertStudent(StuInfoBean stu) {
        return stuInfo.insertStudent(stu);
    }

    @Override
    public String getUsernameById(String id) {
        return stuInfo.getUsernameById(id);
    }

    @Override
    public List<StuInfoBean> findAllStudents() {
        return stuInfo.findAllStudents();
    }

    @Override
    public StuInfoBean findStudentById(String id) {
        return stuInfo.findStudentById(id);
    }

    @Override
    public List<StuInfoBean> findStudentsByName(String name) {
        return stuInfo.findStudentsByName(name);
    }

    @Override
    public List<StuInfoBean> findStudentsByClass(String stuClass) {
        return stuInfo.findStudentsByClass(stuClass);
    }

    @Override
    public List<StuInfoBean> findStudentsByCollege(String college) {
        return stuInfo.findStudentsByCollege(college);
    }

    @Override
    public List<StuInfoBean> findStudentsByMajor(String major) {
        return stuInfo.findStudentsByMajor(major);
    }

    @Override
    public int deleteStudentById(String id) {
        return stuInfo.deleteStudentById(id);
    }

    @Override
    public int updateStudent(StuInfoBean stu) {
        return stuInfo.updateStudent(stu);
    }
}
